FROM php:7.4-fpm-alpine

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories

RUN apk update && apk add \
    build-base \
    git \
    composer

RUN docker-php-ext-install pdo_mysql

RUN addgroup -g 1000 -S www && \
    adduser -u 1000 -S www -G www

RUN git clone https://gitee.com/chen2366/mvcframework.git /var/www/mvc
RUN cd /var/www/mvc && composer install

RUN chown -R www:www /var/www/
USER www
WORKDIR /var/www/mvc

EXPOSE 9000
